import 'package:f_demo_one/components/shop_item.dart';
import 'package:flutter/material.dart';

class MyListViewThree extends StatelessWidget {
  const MyListViewThree({super.key});

  @override
  Widget build(BuildContext context) {
    return ListView.separated(
        itemBuilder: (context, index) => const ShopItem(),
        separatorBuilder: (context, index) {
          return Container(
            height: 10,
            decoration: const BoxDecoration(
              color: Colors.green,
            ),
            margin: const EdgeInsets.symmetric(vertical: 10),
            child: const Divider(height: 1, color: Colors.yellow),
          );
        },
        itemCount: 15);
  }

  Widget _listItem() {
    return Container(
      height: 80,
      padding: const EdgeInsets.all(10),
      child: Row(
        children: [
          Image.network(
            'https://yanxuan-item.nosdn.127.net/a09de222ed32efa8ffe359b1d5780574.jpg',
            width: 80,
            height: 80,
          ),
          const Expanded(
            child: Text(
              '茶水分离杯耐热隔热玻璃杯 茶水分离杯耐热隔热玻璃杯茶水分离杯耐热',
              maxLines: 2,
              overflow: TextOverflow.ellipsis,
            ),
          ),
          const Icon(
            Icons.arrow_forward_ios,
            color: Colors.grey,
            size: 18,
          ),
        ],
      ),
    );
  }
}
